Below is a graph containing all the coordinate information. We are able to now see cases for individual counties in the US allowing us to see many more points.
Next we can zoom in on the US (filtering out Alaska and Hawaii). Entries with lat/long of 0 have also been disregarded
By using different methods and color palettes we can create different versions of the graph above
there are many R color palettes to choose from or you can create your own. In the above a simple gradient is used. The example from Anisa Dhana uses the viridis palatte which is designed to be perceived by viewers with common forms of colour blindness. Here is an example using a different color package - Wes Anderson. …and more
If we only look at Massachusetts only
* Note the cases on Nantucket and Dukes counties were reported as one value and not included on the graph. There is also an asssigned category that includes 303 Confirmed cases as of 3/31/2020.
## # A tibble: 16 x 2
## Admin2 Confirmed
## <chr> <dbl>
## 1 barnstable 100
## 2 berkshire 105
## 3 bristol 129
## 4 dukes 0
## 5 dukes and nantucket 4
## 6 essex 350
## 7 franklin 24
## 8 hampden 90
## 9 hampshire 20
## 10 middlesex 685
## 11 nantucket 0
## 12 norfolk 393
## 13 plymouth 187
## 14 suffolk 631
## 15 unassigned 303
## 16 worcester 219
Early in the semester, plotly was introduced. It provides us with a way to make interactive grpahs
Animated graphs when down right have a great visual impact. You can do this in R and have your animations embedded on your web page. Essentially gganimate creates a series of files that are encompassed in a gif file. In addition to having this gif as part of your report file, you can save the gif and use in a slide or other presentations. It just takes a few lines of code to covert and existing ggplot graph into an animation.
The time series data is ripe for animation but first we need to get and format the files
Below are the packages I installed. There may be others that you need, in particular to rendering gifs. Some of the example may take several minutes to create the animation.
An animation of the confirmed cases in select countries
Animation for Prof. Chris Sunderland’s example
As of April 3rd, 2020 ther is over 1 million confirmed cases of COVID-19 around the world. A visualization of the spread of these cases around the world can be seen in FIG1.
Figure 1 General distribution of COVID-19 around the world by country. Confirmed refers the log10 transformation of confirmed cases by country to get a better idea the actual distribution rather than simple raw numbers.
Based upon reports, the confirmed number of cases of COVID-19 in China, where the virus first appeared have semmingly flat lined (that is the curve has plateaued meaning the amount of confirmed cases is not showing any more significant increases). While there has been much debate recenly around the accuracy of this infromation, it would suggest that the virus has run its complete course through the country. To get a better idea of this, we can take a look at FIG2 which provides us with a time lapse of how the total number of cases for the country of China. This could possibly be helful as it might give us an idea of how the virus will affect other countries around the world. Specifically, I believe it could be used to project numbers on confirmed cases as well as lethality of the virus and how long it takes patients to recover.
Figure 2 Time series graph of confirmed cases, deaths, and recovered COVID-19 cases in China.
One of the explanations for such a drastic flattening of the curve in COVID-19 cases can be attributed to the mandatory lockdown and shutdown of various cities across the province of Hubei including the epicenter of the virus, Wuhan. This is apparent by looking at FIG3 below which shows the distribution of the total confirmed cases in China for varying provinces. Due to the nature of the map, all of the provinces unamed. As a result FIG4 can provide a helpful guide to seeing the provinces in their English romanized names.
## OGR data source with driver: ESRI Shapefile
## Source: "C:\Users\jdblu\Documents\Spring 2020 UMass\Bio497G\genome-analysis\china_shapefile", layer: "bou2_4p"
## with 925 features
## It has 7 fields
## Integer64 fields read as strings: BOU2_4M_ BOU2_4M_ID
Figure 3 map of confirmed COVID-19 cases in china distributed by local provinces
Figure 4 Map of Chinese provinces with romanized province names
Although most of the cases in China were isolated in the Hubei province, it is also interesting to see the spread of the virus around the provinces over time. This we can see this in Figure 5 below. While it is already known that the virus originated in the city of Wuhan, this figure clearly shows that as well as how it spread to the surrounding areas of the country since the declaration of the pandemic
Figure 5 Time lapse of virus spread in China
After looking at the data however, what is interesting is that even though China has the largest population in the world, it is 5th in terms of overall confirmed cases. In fact the countries above them in case numbers are significantly smaller than them in comparison. This disparity can be made more apparent by viewing Figure 6 Where we can see the timeline of confirmed cases for the 5 countries with the highest number of cases.While there is most certainly a discrepency in the way that numbers for these types of situations gets reported, I believe that this data casts some suspcision on the numbers that are being reported around the world.
Figure 6 Time Series graphs of total cases, deaths, and recoveries for 5 countries with the highest number of cases
Moving on, I wanted to next focus on look at the virus on a much more local scale to see how the virus is taking course in Massachusetts. It is known that the state of Massachusetts expereinced a large spike in cases after a Biogen hosted conference that resulted in a great deal of people becoming infected. As a result of this, we can see that Mass is currently 5th in terms of total confirmed cases even though it is the 15th biggest state in the country. This is apparent by Figure 7 and as well as Figure 8.
Figure 7 Interactive United States heatmap of confirmed COVID-19 cases
## # A tibble: 9 x 2
## Province_State Confirmed
## <chr> <dbl>
## 1 new york 44876
## 2 new jersey 8825
## 3 california 4657
## 4 michigan 3634
## 5 washington 3477
## 6 massachusetts 3240
## 7 illinois 3024
## 8 florida 2900
## 9 louisiana 2744
Figure 8 10 US States with highest confirmed cases of COVID-19
Going even deeper, looking at Figure 9 which was provided to us by the help of professor Jeffrey Blanchard from the Univeristy of Massachusetts Amherst, we can get a look at how the virus has spread through the individual counties of Massachusetts. It is interesting to note that when looking at the distribution, we can see that Boston (Suffolk County) which is the hub of the state does not even have the most cases, but is in fact Middlesex county.
Figure 9 Interactive map of confirmed COVID-19 cases in Massachusetts by county (Dukes and Nantucket county appear to have 0 because they are counted as a single county in the data and therefore cannot be properly distinguised)
Overall, while it hard to make any defintive observations based upon the data we have been given and the visualizations seen above, it is apparent in the trends the for the United States, there is still a long way to go before the spread of the virus settles down. When comparing data with the countries like China and Japan, it appears that we have failed to stop the spreading the same way they have which should be cause for us to reflect on our internal healthcare system. It also raises eyebrows as to whether or not some of these numbers are correct. This data also did not take into account testing as the US has rapidly began testing more patients as time has gone on. In the future, as more data becomes available, it would be interesting to look into specific types of cases such as looking at asymptomatic carriers, mild cases, and more severe cases. While the above data may not revolutionary it is meant to be an insightful look into the state of the world and some of its countries as we face this new pandemic.